﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

public class BoundryObject : CollidableObject
{
    protected new BoundryObject.Type thisType;

    public BoundryObject(BoundryObject.Type type, Vector3 center)
        : base(type, center)
    {
        init(type, center);
    }

    private void init(BoundryObject.Type type, Vector3 center)
    {
        thisType = type;
    }

    public new class Type : CollidableObject.Type
    {
            //static world objects
        public static readonly Type SideBoundry = new Type(
            ObjectFactory.TypeEnum.SideBoundry,//type
            new Vector3(0,0,0),//origin
            new Vector3(1,99999,1000));//collision
        public static readonly Type HeightBoundry = new Type(
            ObjectFactory.TypeEnum.HeightBoundry,//type
            new Vector3(0,0,0),//origin
            new Vector3(99999,1,1000));//collision
        public static readonly Type DepthBoundry = new Type(
            ObjectFactory.TypeEnum.DepthBoundry,//type
            new Vector3(0,0,0),//origin
            new Vector3(99999,99999,1));//collision

        //animation info for the stasis animation
        //but each instance of ViewableObject 
        //needs its own Animation instance
        
        public Boolean walkable
        {
            get { return walkOn; }
        }
        protected Boolean walkOn = false;

        /**
         * this is a dummy constructor.
         */
        protected Type() { }

        /**
         * Private constructor.
         * This private constructor ensures that only 
         * the pre-specified Type objects can be used 
         * and compared against.
         * @param type the type of this object.
         * @param origin the point that is used for placement of this
         * object's collision cube.
         * @param collision the size of the collision cube.
         * @param walkable whether or not this object can be walked on.
         */
        protected Type(ObjectFactory.TypeEnum type,Vector3 origin, Vector3 collision, Boolean walkable)
            : base(type, origin, collision)
        {
            init(walkable);
        }

        protected Type(ObjectFactory.TypeEnum type, Vector3 origin, Vector3 collision)
            : base(type, origin, collision)
        {
            init(false);
        }

        protected void init(Boolean walkable)
        {
            walkOn = walkable;
        }

        public static BoundryObject.Type getType(ObjectFactory.TypeEnum te)
        {
            switch (te)
            {
                case ObjectFactory.TypeEnum.SideBoundry: return SideBoundry;
                case ObjectFactory.TypeEnum.HeightBoundry: return HeightBoundry;
                case ObjectFactory.TypeEnum.DepthBoundry: return DepthBoundry;
            }
            return null;
        }
    }
}


